package com.company.project.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("topology_history")
public class TopologyHistory {
    @TableId
    private String id;

    @TableField("name")
    private String name;

    @TableField("file_path")
    private String filePath;

    @TableField("create_time")
    private Date createTime;

    @TableField("file_hash")
    private String fileHash;

    public TopologyHistory(String name, String filePath, String fileHash) {
        this.id = java.util.UUID.randomUUID().toString();
        this.name = name;
        this.filePath = filePath;
        this.fileHash = fileHash;
        this.createTime = new Date();
    }
}
